package com.zik.vod.controller;

import com.zik.swagger.result.Result;
import com.zik.vod.service.FileService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.tomcat.jni.Multicast;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author: zik_zhou
 * @Date: 2023-04-30 21:21
 * @Operation:
 * @Description: 文件上传接口
 **/
@Api(tags = "文件上传接口")
@RestController
@RequestMapping("/admin/vod/file")
public class FileUploadController {
    @Autowired
    private FileService fileService;


    @ApiOperation("文件上传")
    @PostMapping("upload")
    public Result uploadFile(@ApiParam(name = "file", value = "文件", required = true)
                                 @RequestParam("file") MultipartFile file) {

        String upload = fileService.upload(file);
        return Result.ok(upload).message("文件上传成功");    }
}
